Program Organization Units

Within IECClosed"International Electrotechnical Commission" IEC is a not-for-profit, non-governmental international standards organization that prepares and publishes International Standards for all electrical, electronic and related technologies 61131-3, the Functions, Function Blocks, and Programs are called Program Organization Units (POUClosed"Programmable Organization Unit" An application is a list of programs. Programs are executed sequentially within the target cycle according to the order defined by the user and displayed in the Project View).

In addition to the IEC standard, you can write you own code: sub-program or UDFBClosed"User Defined Function Block" UDFB can be used as a sub-function block in another program of the application. It is described using FBD, LD, ST or IL language. Input / output parameters of a UDFB (as well as private variables) are declared in the variable editor as local variables of the UDFB.

Types IEC 61131-3 Written by end-user
Basic functions (has no memory) Functions Programs / Sub-programs
Instantiated functions (keep track of the past) Function Blocks (FB) User-Defined Function Blocks (UDFB)

Difference between Functions and Function Blocks

  • Functions are expected to complete in one cycle
  • Function Blocks can take several cycles to complete

Description of FB operation

Rather than halt the application, waiting for operations to complete, the FB typically gives control back to the application but does not set its Done output.

Examples of Operations Overrunning the Cycle Duration

  • A motion command to move from one location to another can take several cycles to complete.
  • Same for operations like reading/writing to files or reading and writing over TCP/IP can also take several cycles to complete.

Operation Sequence

  1. When a FB is called, it starts an operation and possibly does not complete it
  2. The FB is called in the next cycle, and it checks to determine if the operation is done
  3. If it is done, it sets the Done output. If not, it continues on
  4. Now the application knows that the operation is complete and can do what ever other processing it needs based on the FB being done